template <class T>
static BinNodePosi(T) removeAt(BinNodePosi(T) &p, BinNodePosi(T) &hot) {
	/* w ponits to the node that is actually deleted.  */
	BinNodePosi(T) w = p;
	/* succ is the successor of the node that is actually deleted.  */
	BinNodePosi(T) succ = NULL;

	if(!HasLChild(*p)) {
		succ = p = p->rc;
	}
	else if(!HasRChild(*p)) {
		succ = p = p->lc;
	}
	else {
		w = w->succ();
		std::swap(w->data, p->data);
		/* U is the parent of the node to be deleted, and P is the node to be deleted originally . 
		 * if u is equal to p, w is the rchild of u,
		 * else w is the lchild of u .
		 * succ is always w->rc;
		 */
		BinNodePosi(T) u = w->parent;
		((u + 0 == p) ? u->rc : u->lc) = succ = w->rc;
	}

	/**
	 * @brief record the parent of the deleted node.
	 * 
	 */
	hot = w->parent;
	/* If a parent node exists, a bidirectional handshake is required.  */
	if(succ) succ->parent = hot;
	release(w->data);
	release(w);
	return succ;
}

template <class T>
bool BST<T>::remove(const T &e) {
	BinNodePosi(T) &p = search(e);
	if(!p) return false;

	removeAt(p, this->_hot);
	this->_size--;
	this->updateHeightAbove(this->_hot);

	return true;
}